<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>地震局培训平台</title>
		<link rel="stylesheet" href="style/main.css" />
		<link rel="stylesheet" href="style/help.css" />
	</head>

	<body>
		<div id="info">
			<div class="info">
				<div class="newsbox">
					<!--消息滚动-->
					<div class="news nowrap">消息：欢迎加入地震应急志愿者培训平台，您是第123456位访问用户。</div>
				</div>
				<div class="infobox">
					<div class="name nowrap">zhangming</div>
					<div class="info_id nowrap">N.8784547</div>
					<div class="sign_out">退出</div>
				</div>
				<div class="leave_m">互动留言</div>
			</div>
		</div>
		<div id="show">
			<nav id="nav">
				<div class="top">
					<div class="logo"></div>
					<div class="seachbox">
						<input type="text" id="search" value="在线课堂搜索" />
						<div class="weibo codeIcon">
							<div class="first">
								<img src="image/weiboCode.png" />
							</div>
						</div>
						<div class="weixin codeIcon">
							<div class="first">
								<img src="image/weixinCode.png" />
							</div>
						</div>
					</div>
				</div>
				<div class="border">
					<ul class="nav">
						<li class="in" data-url="index">首页</li>
						<li data-url="news">新闻资讯</li>
						<!--<li data-url="story">志愿故事</li>-->
						<li class="team">志愿品牌
							<div class="first">
								<div data-url="story">志愿故事</div>
								<div data-url="team">志愿团体</div>
								<div data-url="star">志愿之星</div>
							</div>
						</li>
						<!--<li data-url="project">志愿项目</li>
						<li data-url="star">志愿之星</li>-->
						<li data-url="train">培训平台</li>
						<li data-url="policy">志愿政策</li>
					</ul>
				</div>
			</nav>
			<div id="content">
				<div class="left">
					<div class="border"></div>
					<div class="list" id="listData">
						<!-- <div class="box">
							<div class="title">希望加入志愿活动</div>
							<div class="infobox">
								<div class="address1">区域：<span></span>昌平区</div>
								<div class="address2">详细地址：<span>北京昌平区南口红泥沟</span></div>
								<div class="nikename">发布：<span>wjm1990 王建敏</span></div>
							</div>
							<div class="text">我是一名普通职工，很想参加志愿活动，多多接触人群，走出自己的世界，也许能力有限，但希望学会奉献一份自己的力量，不知道哪里有需要，可以联系我，尽管相距较远，也愿千里奔赴。</div>
							<div class="time">2018-01-08  10:32:36</div>
						</div> -->
						
					</div>
					<div class="pagebox">
					<div class="pageborder"></div>
					<div class="numbox">
						<div class="page">1</div>
						<div class="page in">2</div>
						<div class="page">3</div>
					</div>
				</div>
				</div>
				<div class="right">
					<div class="border"></div>
					<div class="title"></div>
					<div class="text">任何人都可以在这里发布求助信息，无需注册登录。但是请务必求助的都是真实的，留下的信息务必真实有效。</div>
					<form action="http://101.201.113.151:9230/forhelp/saveHelpinfo" id="myForm" method="get">
						<div class="inputbox">
							<div class="text2">*求助标题</div>
							<input type="text" class="helptitle" name="helptitle"/>
						</div>
						<div class="inputbox">
							<div class="text2">*求助内容</div>
							<textarea class="" class="content" name= "content"></textarea>
						</div>
						<div class="inputbox">
							<div class="text2">*所在区域</div>
							<input type="text" class="area" name= "area" />
						</div>
						<div class="inputbox">
							<div class="text2">*详细地址</div>
							<input type="text" class="address" name="address" />
						</div>
						<div class="inputbox">
							<div class="text2">*求助人</div>
							<input type="text" class="createman" name="createman" />
						</div>
						<div class="inputbox">
							<div class="text2">*联系电话</div>
							<input type="text" class="telphone" name="telphone" />
						</div>
						<div ></div>
						<input type="submit" value="" class="sendbtn">
					</form>
					
				</div>
			</div>
		</div>
		<div id="bottom">
			<ul class="border">
				<li>相关协作单位：</li>
				<li>中国红十字会</li>
				<li>中科院心理所</li>
				<li>中国地震信息网</li>
				<li>中国地震科普网</li>
				<li>北京市地震局科普网 </li>
				<li>科普网</li>
			</ul>
			<div class="bottom">
				<ul class="one">
					<li>设为首页</li>
					<li>交换链接</li>
					<li>关于我们</li>
					<li>联系我们</li>
					<li>常见问题</li>
					<li>心理教室</li>
					<li>党团建设</li>
				</ul>
				<ul class="two">
					<li>主办：北京市地震局</li>
					<li>版权所有 京ICP备08988239</li>
					<li>技术支持：中宣助力传媒</li>
				</ul>
			</div>
			<script type="text/javascript" src="script/jquery.min.js"></script>
			<script type="text/javascript" src="script/ishoock.tools.js"></script>
			<script type="text/javascript" src="script/main.js"></script>
			<script type="text/javascript" src="script/common.js"></script>
			<script>
				// 获取求助中心数据请求
				$.ajax({
					type: "GET",
					url: host +"forhelp/getHelpInfo",
					dataType: "json",
					success: function(data){
                        console.log(data)	
					    $.each(data.result,function(index,item){
					    	$('#listData').append('<div class="box">'+
							                         '<input type="hidden" value="'+item.id+'" class="listId">'+
													'<div class="title help_title">'+item.helpTitle+'</div>'+
													'<div class="infobox">'+
														'<div class="address1">区域：<span></span>'+item.area+'</div>'+
														'<div class="address2">详细地址：<span>'+item.address+'</span><span>　发布：'+item.createMan+'</span></div>'+
													'</div>'+
													'<div class="text">'+item.helpContent+'</div>'+
													'<div class="time">'+item.createDate+'</div>'+
												'</div>')
						  		
				　　　　　　　
					    })
						
						$('.help_title').click(function(){
							var listId = $(this).prev('.listId').val();
							console.log(listId)
							window.location.href = "details_help.html?id="+listId;
						})	
						
						
					}
				
				})
				
				$('.sendbtn').click(function(){
					if($('.helptitle').val() == ""){
						alert('请填写求助标题');
						return false;
					}else if($('.content').text() == ""){
						alert('请填写求助内容');
						return false;
					}else if($('.area').val() == ""){
						alert('请填写所在区域');
						return false;
					}else if($('.address').val() == ""){
						alert('请填写详细地址');
						return false;
					}else if($('.createman').val() == ""){
						alert('请填写求助人');
						return false;
					}else if($('.telphone').val() == ""){
						alert('请填写联系电话');
						return false;
					}else{
						$("#myForm").ajaxSubmit();
					}
					
				})
				
				
				
			</script>

			
	</body>

</html>